window.addEventListener('load',function(){
    var login = document.querySelector('.login');
    var mask = document.querySelector('.login-bg');
    var link = document.querySelector('#link');
    var closeBtn = document.querySelector('.close-login');
    // 点击就弹出登录框和 背景
    link.addEventListener('click',function(){
        login.style.display = 'block';
        mask.style.display = 'block';
    })
    //关闭登陆框
    closeBtn.addEventListener('click',function(){
        login.style.display = 'none';
        mask.style.display = 'none';
    })
    //特效的js
    $(document).ready(function(){
        var stars=800;
        var $stars=$(".stars");
        var r=800;
        for(var i=0;i<stars;i++){
            var $star=$("<div/>").addClass("star");
            $stars.append($star);
        }
        $(".star").each(function(){
            var cur=$(this);
            var s=0.2+(Math.random()*1);
            var curR=r+(Math.random()*300);
            cur.css({
                transformOrigin:"0 0 "+curR+"px",
                transform:" translate3d(0,0,-"+curR+"px) rotateY("+(Math.random()*360)+"deg) rotateX("+(Math.random()*-50)+"deg) scale("+s+","+s+")"

            })
        })
    })
})
